import React,{useState,useEffect} from 'react'
import axios from 'axios'
import {useNavigate} from 'react-router-dom'
export default function Ok() {
    let navigate=useNavigate()
    let [list1,setList1]=useState([])
    let [list2,setList2]=useState([])
    let [list3,setList3]=useState([])
    useEffect(()=>{
        getRenwu()
    },[])
    let getRenwu=async()=>{
        let {data:{list1,list2,list3}} = await axios.get('http://localhost:3000/renwu')
        setList1(list1)
        setList2(list2)
        setList3(list3)
    }
  return (
    <div>
        <h1>项目一</h1>
        <div>
            <span style={{marginRight:'20px'}} onClick={()=>navigate('/index/list')}>任务板</span>
            <span style={{marginRight:'20px'}}>附件</span>
            <span style={{marginRight:'20px'}}>任务任务</span>
            <span style={{marginRight:'20px',color:'red'}}>归档任务</span>
        </div>
         {list1.filter(i=>i.status).map((item,index)=>(
            <div key={item._id}>
                <span >
                    <input type='checkbox' checked={true}  />
                </span>
                <span>{item.name}</span>
            </div>
        ))}
    </div>
  )
}
